#ifndef __APP_INIT_H
#define __APP_INIT_H


extern const char g_acRgbaArray[];
extern int g_acRgbaArrayLen;

void show_mbox_msg(const char * txt, const int tm_ms);

#define CPU_804 0
#define CPU_805 1

#define SW_VER "T1R1C01B031CK804SP6"

//#define IPC_REGISTER_REQUEST                0x0101
//#define IPC_REGISTER_RESPONSE               0x0102
//
//#define IPC_RECOGNIZED                      0x0203
//
//#define IPC_REGISTER_REQUEST_NOIMAGE        0x0301
//#define IPC_REGISTER_RESPONSE_NOIMAGE       0x0302
//
//////////////////////
//#define IPC_REGISTER_RESPONSE_NOFICE       0X0205
//#define IPC_REGISTER_REQUEST_NOFICE        0X0206
//
//#define IPC_REGISTER_RESPONSE_TIMEOUT      0X0207
//#define IPC_REGISTER_REQUEST_TIMEOUT       0X0208
//
///* ID : AIE data write to flash or read */
//#define IPC_AIE_INIT_DATA_IS_READY          0x0209 /* finish read date from flash */
//#define IPC_AIE_INIT_REQUEST_WRITE_DATA     0X020A /* request to write data */
//
//#define IPC_RECOGNIZED_FAILED               0x020B
//#define IPC_RECOGNIZED_FAILEDACK            0x020C
//
//
///* Camera module id 0x0400 */
//#define IPC_CAMERA_REG_SET                 0x0401
//#define IPC_CAMERA_REG_GET                 0x0402
//
///* VO module id 0x0500 */
//#define IPC_VO_SNAPSHOT_REQUEST            0x0501
//#define IPC_VO_SNAPSHOT_RESPONSE           0xA501
//#define IPC_VO_SNAPSHOT_ERROR              0xE501
//#define IPC_VO_SNAPSHOT_DONE               0x0502
//#define IPC_VO_SNAPSHOT_DONE_ACK           0xE502
//
///* LED module id 0x0600 */
//#define IPC_LED_REG_SET                    0x0601
//#define IPC_LED_REG_GET                    0x0602

typedef enum  {
  VO_CHANNEL_INVALID                = 0,
  VO_CHANNEL_UART                   = 1,
  VO_CHANNEL_SDCARD                 = 2,
  VO_CHANNEL_MAX,
}vo_channel_t;

typedef enum  {
  VO_IMAGE_SOURCE_INVALID               = 0,
  VO_IMAGE_SOURCE_RGBA                  = 1,
  VO_IMAGE_SOURCE_IR                    = 2,
  VO_IMAGE_SOURCE_SPK_LEFT              = 3,
  VO_IMAGE_SOURCE_SPK_RIGHT             = 4,
  VO_IMAGE_SOURCE_DEPTH                 = 5,
  VO_IMAGE_SOURCE_MAX,
}vo_image_source_t;

struct vo_image_src {
    uint32_t set;
    uint32_t image_width;
    uint32_t image_hight;
    uint32_t pixel_width;
    uint32_t image_address;
    uint32_t vo_channel;
};

extern char g_vo_image_str[VO_IMAGE_SOURCE_MAX][16];
//extern struct vo_image_src g_vo_image_sources[VO_IMAGE_SOURCE_MAX];
extern struct vo_image_src *g_vo_image_sources;


void QSPI_flash_init();

int32_t custom_flash_read(uint32_t offset, void *buf, uint32_t nbytes);
int32_t custom_flash_write(uint32_t offset, void *buf, uint32_t nbytes);
int32_t custom_flash_erase(uint32_t offset, uint32_t size);

#endif
